home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1999 September / DPPCPRO0999.ISO / Macromed / Flash2 / CD Extras / WebTools / JBS.DXR / 00070_stickey script.ls < prev    next >
Encoding:
Text File  |  1997-04-13  |  971 b   |  37 lines

  1. on mouseDown
  2.   global MorphBase, stuckState, StretchFactor
  3.   if doubleClick() then
  4.     if stuckState < 0 then
  5.       repeat with stuckState = stuckState to 0
  6.         set the castNum of sprite clickOn() to MorphBase + stuckState
  7.         updateStage()
  8.       end repeat
  9.     else
  10.       if stuckState > 0 then
  11.         repeat with stuckState = stuckState down to 0
  12.           set the castNum of sprite clickOn() to MorphBase + stuckState
  13.           updateStage()
  14.         end repeat
  15.       end if
  16.     end if
  17.   else
  18.     set Hbase to mouseH()
  19.     repeat while 1
  20.       set deltaH to (mouseH() - Hbase) / StretchFactor
  21.       set phase to stuckState + deltaH
  22.       if phase < -17 then
  23.         set phase to -17
  24.       end if
  25.       if phase > 17 then
  26.         set phase to 17
  27.       end if
  28.       set the castNum of sprite clickOn() to MorphBase + phase
  29.       updateStage()
  30.       if not stillDown() then
  31.         exit repeat
  32.       end if
  33.     end repeat
  34.     set stuckState to phase
  35.   end if
  36. end
  37.